import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { TabsPage } from './tabs.page';
import { IndexOperationPage } from '@pages/home/index-operation/index-operation';
import { IndexGroupPage } from '@pages/home/index-group/index-group';
import { IndexProjectPage } from '@pages/home/index-project/index-project';
import { Page404 } from '@pages/home/page404/page404';
import { CacheService } from '@services/cache.service'



const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children: [
      {
        path: 'home',
        children: [
          { path: '', loadChildren: '../pages/home/home.module#HomePageModule' },
          { path: 'indexOperation', component: IndexOperationPage },
          { path: 'indexGroup', component: IndexGroupPage },
          { path: 'indexProject', component: IndexProjectPage },
          { path: 'page404', component: Page404 },
        ]
      },
      {
        path: 'alarm',
        children: [
          {path: '', loadChildren: '../pages/alarm/alarm.module#AlarmPageModule'}
        ],
      },
      {
        path: 'my',
        loadChildren: '../pages/my/my.module#MyPageModule'
      },
      { path: '', redirectTo: '/tabs/home', pathMatch: 'full' },
    ]
  },
  { path: '', redirectTo: '/tabs/home', pathMatch: 'full' },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class TabsPageRoutingModule {
}

